﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Service.Model.Map
{
    public class HeuristicMap : EntityTypeConfiguration<Heuristic>
    {
        public HeuristicMap()
        {
            ToTable("dbo.Heuristics");
            HasKey(h => h.HeuristicId);

            Property(p => p.HeuristicId).HasColumnName("HeuristicId").IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(h => h.HeuristicName).HasColumnName("HeuristicName").IsRequired();

            HasMany(h => h.PlayerHeuristics).WithRequired(p => p.Heuristic).HasForeignKey(h => h.HeuristicId);
        }
    }
}